/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package yudisium;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JPanel;

public class FrameUtama extends JFrame {
 private JButton btMahasiswa, btSekre;
    private JLabel title;
    private JPanel jp;
    private JMenuBar menubar;
    private JMenu menuBerkas,menuPilih;
    private JMenuItem menuKeluar,exit,bantuan,ttg;

    public FrameUtama(){
        this.setTitle("Welcome To Main Frame");
        this.setFont(new java.awt.Font("Tahoma",0,28));
        this.setSize(800, 400);
        this.setResizable(false);
        this.setVisible(true);
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
  
        menubar=new JMenuBar();
        menuBerkas=new JMenu("Berkas");
        menuPilih = new JMenu("Pilihan");
        menuKeluar=new JMenuItem("Keluar");
        menuKeluar.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                System.exit(3);
            }
        });
        menubar.add(menuBerkas);
        menubar.add(menuPilih);
        menuBerkas.add(menuKeluar);
        bantuan = new JMenuItem("Bantuan");
        bantuan.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                JOptionPane.showMessageDialog(null, "Button Mahasiswa untuk User Mahasiswa "
                        + "\n Button Sekretariat untuk Pegawai");
            }
        });
        ttg = new JMenuItem("Tentang Kami");
        ttg.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JOptionPane.showMessageDialog(null, "Kelompok 9 :\n1.Paulus Dian W (115314068)"
                        +"\n2.Dwi Prabowo (115314060)\n3.Virgilius B.T (115314019)"
                        + "\n4.Elisabeth F.Tokan (115314033)");
            }
        });
        menuPilih.add(bantuan);
        menuPilih.add(ttg);
        this.setJMenuBar(menubar);
        jp = new JPanel();
        jp.setSize(400, 400);
        jp.setLayout(null);
        jp.setVisible(true);
        this.add(jp);
        title = new JLabel();
        title.setText(" Selamat Datang di Yudisium");
        title.setFont(new java.awt.Font("Tahoma", 0, 26));
        title.setBounds(210,0,350,40);
        title.setVisible(true);
        jp.add(title);
        btMahasiswa = new JButton();
        btMahasiswa.setText("Mahasiswa");
        btMahasiswa.setBounds(200, 170, 150, 30);
        btMahasiswa.setVisible(true);
        jp.add(btMahasiswa);
            btMahasiswa.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JDialog dialog = new JDialog();
              PanelKelasMahasiswa pnl = new PanelKelasMahasiswa();
                dialog.setTitle("Mahasiswa");
                dialog.setSize(700, 500);
                dialog.setVisible(true);
                dialog.setResizable(true);
                dialog.add(pnl);
            }
        });
        btSekre = new JButton();
        btSekre.setText("Sekretariat");
        btSekre.setBounds(440, 170, 150, 30);
        btSekre.setVisible(true);
        jp.add(btSekre);
           btSekre.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JDialog dialog = new JDialog();
                PanelKelasSekretariat ps = new PanelKelasSekretariat();
                dialog.setTitle("Sekretariat");
                dialog.setSize(700, 600);
                dialog.setVisible(true);
                dialog.setResizable(true);
                dialog.add(ps);
            }
        });
    }
    public static void main(String[] args) {
        // TODO code application logic here
        FrameUtama Frame = new FrameUtama();
    }
}

